package net.mof.manual

/**
 *
 * 被標記的类的信息，包括包名，類名
 * *
 * Created by LiYueHui on 2020/2/2.
 */
class MarkedClassInfo(private var majorName: String? = null,
                      private val minorName: String? = null) {

    private var isInnerClass: Boolean = false

    init {
        isInnerClass = this.majorName != null && this.majorName != ""
    }

    // format YYY.XXX or XXX
    fun getClassName(): String? {
        return if (isInnerClass) majorName + "." + minorName else minorName
    }

    // format YYY$XXX or xxx
    fun getClassName_with_dollar(): String? {
        return if (isInnerClass) majorName + "$" + minorName else minorName
    }


    // format YYYXXX or XXX
    fun getFileName(): String? {
        val fileName = if (isInnerClass) majorName + minorName else minorName
        return fileName?.toLowerCase()
    }


}